﻿using NetEasyMusic.Lib.Models;
using Newtonsoft.Json.Linq;

namespace NetEasyMusic.Lib.Recommend;

public class TopMVRecommend : IRecommend
{
    public TopMVRecommend(JToken token)
    {
        Id = token["id"]?.ToObject<string>()!;
        PicUrl = token["cover"]?.ToObject<string>()!;
        Name = token["name"]?.ToObject<string>()!;
        PlayCount = token["playCount"]?.ToObject<string>()!;
        Artists = token["mv"]?["artists"]?.Select(x => new ArtistModel(x)).ToArray() ?? [];
    }

    public string Id { get; set; }
    public string PlayCount { get; set; }
    public string Name { get; set; }
    public ArtistModel[] Artists { get; set; }
    public string PicUrl { get; set; }
}